<!DOCTYPE html>
<html lang="en" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../static/js/axios.js"></script>
    <script src="../static/js/vue.js"></script>

</head>
<body>

<div id="app">

    <form>
        <fieldset>
            <legend>JD</legend>
            <div>
                <input v-model="keyword" type="text"><br>
                <button type="submit" @click.prevent="searchKey"> 搜索 </button>
            </div>
        </fieldset>
    </form>

</div>



<script type="text/javascript">

    new Vue({
        el: "#app",
        data: {
            keyword: '',  // 搜索关键字
            result: []    // 搜索结果
        },
        methods:{
            searchKey(){
                var keyword = this.keyword;
                console.log(keyword)
                axios.get('search/'+keyword+'/1/10').then(response=>{
                    console.log(response)
                    this.result = response.data;
                })
            }
        }
    })

</script>

</body>
</html>
